package com.yupi.springbootinit.utils;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;



public class DateUtils {
    public static String toRFC1123() {
        LocalDateTime now = LocalDateTime.now();
        ZonedDateTime gmt = now.atZone(ZoneId.of("GMT"));
        DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
        String format = gmt.format(timeFormatter);
        return format;
    }
}
